//
//  assistButton.swift
//  Motion
//
//  Created by 悦月越悦 on 2021/3/19.
//

import SwiftUI

struct AssistButton: View {
    @State private var showingAlert = false
    
    var body: some View {
        VStack{
            Button(action: {
                showingAlert.toggle()
            }) {
                Image("x")
                    .squareImage(size: 45)
            }
            .alert(isPresented: $showingAlert) {
                Alert(title: Text("小朋友你确定要退出嘛🥺"),primaryButton:.default(Text("继续运动"), action:{}),secondaryButton:  .destructive(Text("忍痛离开"),action: {}))
            }
            
            Image("x")
                .squareImage(size: 45)
        }
    }
}

struct assistButton_Previews: PreviewProvider {
    static var previews: some View {
        AssistButton()
    }
}
